<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>该部门用户周报列表</title>
<LINK rel="stylesheet" type="text/css"
	href="${baseurl}js/easyui/styles/default.css">
<%@ include file="/WEB-INF/views/common_css.jsp"%>
<%@ include file="/WEB-INF/views/common_js.jsp"%>
<script type="text/javascript">
/* 翻页 */
$(function(){
	$('#pp').pagination({
	    total:${groupSum},
	    pageSize:1,
	    pageList:[1],
	    pageNumber:${groupId},
	    afterPageText:"星期",
	    displayMsg:"目前共有${groupSum}周的周报！",
	    onSelectPage:function(pageNumber, pageSize){
			$(this).pagination('loading');
			//alert('pageNumber:'+pageNumber+',pageSize:'+pageSize);
			reAddTab("周报管理","${baseurl}weeklog/groupWeeklogs/"+$("#selectDepartmentId").val()+"/"+pageNumber);
			$(this).pagination('loaded');
		}
	});
	
	/* 刷新该页面 进入到选定的部门 */
	 $("#submit").click(function(){
		 reAddTab("周报管理","${baseurl}weeklog/groupWeeklogs/"+$("#selectDepartmentId").val()+"/0");
	 }); 
	
});


</script>
</head>
<body>
	<table width="100%" border=1>
		<tr>
			<td>所属部门： 
				<select id="selectDepartmentId">
					<c:forEach items="${vDepartments }" var="department">departmentId
						<c:if test="${department.departmentId == departmentId}">
							<option value="${department.departmentId }" selected="selected">${department.departmentName }</option>
						</c:if>
						<c:if test="${department.departmentId != departmentId}">
							<option value="${department.departmentId }">${department.departmentName }</option>
						</c:if>
					</c:forEach>
				</select>
				<input type="button" value="查询" id="submit"/> 
			</td>
			
			<td>所在部门：${department.departmentName }
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
				所在岗位：${job.jobName }
			</td>
		</tr>
	</table>
	本部门周报列表：
	<table width="100%" border=1 class="huanse">
		<tr align="center">
			<td width="6%"><b>姓名</b></td>
			<td width="34%"><b>本周计划工作内容</b></td>
			<td width="34%"><b>本周主要工作内容</b></td>
			<td width="5%"><b>自我评分</b></td>
			<td width="5%"><b>上级评分</b></td>
			<td width="8%"><b>创建日期</b></td>
			<td width="8%"><b>操作</b></td>
		</tr>
		<c:forEach items="${weeklogs }" var="item">
			<tr align="center">
				<td align="center">${item.user.username }</td>
				<td>${item.planContent }</td>
				<td>${item.mainContent }</td>
				<td>${item.myScore }</td>
				<td>${item.leadScore }</td>
				<td><fmt:formatDate value="${item.createtime}"
						pattern="yyyy-MM-dd" /></td>
				<td>
					<!-- 有item:update权限才显示修改链接，没有该 权限不显示，相当 于if(hasPermission(item:update)) -->
					<shiro:hasPermission name="weeklog:update">
						<a href="javascript:javascript:createmodalwindow('周报总结',0.63,0.54,'${baseurl}weeklog/edit/2/${item.weeklogId}')">查看评阅</a>
					</shiro:hasPermission>
				</td>

			</tr>
		</c:forEach>

	</table>
	<div id="pp" style="background:#efefef;border:1px solid #ccc;"></div>
</body>
</html>